package cn.edu.zut.score.core.convert;

import cn.edu.zut.score.core.dto.response.ConfigResponse;
import cn.edu.zut.score.core.entity.Config;
import io.swagger.annotations.ApiModel;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;


import java.util.List;

/**
 * @author zby
 * @date 2021/06/27
 */
@ApiModel("配置相关转换器")
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface ConfigConvert {

    ConfigConvert INSTANCE = Mappers.getMapper(ConfigConvert.class);

    List<ConfigResponse> configs2Responses(List<Config> configs);

    ConfigResponse config2Response(Config config);

}
